<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="keywords" content="在线答题">
  <meta name="description" content="在线答题是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
  <title>在线答题APP后台管理系统</title>
  <link rel="shortcut icon" href="favicon.ico">
  <link href="../Styles/css/bootstrap.min.css" rel="stylesheet">
  <link href="../Styles/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  <link href="../Styles/css/animate.min.css" rel="stylesheet">
  <link href="../Styles/css/style.min.css" rel="stylesheet">
</head>

<body class="gray-bg">
  <div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
      <div class="col-sm-12">
        <div class="ibox float-e-margins">
          <div class="ibox-content">
            <form class="form-horizontal m-t" id="EditForm">
              <div class="form-group">
                <label class="col-sm-3 control-label">类型名称:</label>
                <div class="col-sm-8">
                  <input type="hidden" id="ID" name="ID">
                  <input id="TypeName" name="TypeName" class="form-control" type="text">
                  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请输入类型名称且不能为空</span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">类型状态：</label>
                <div class="col-sm-8">
                  <select class="form-control m-b" id="StateDisplay" name="StateDisplay">
                    <option selected>可用</option>
                    <option>不可用</option>
                  </select>
                  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请选择类型状态</span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">备注</label>
                <div class="col-sm-8">
                  <textarea id="Remark" name="Remark" class="form-control" style="height:100px"></textarea>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script src="../Scripts/jquery.min.js"></script>
  <script src="../Scripts/bootstrap.min.js"></script>
  <script src="../Scripts/content.min.js"></script>
  <script src="../Scripts/plugins/validate/jquery.validate.min.js"></script>
  <script src="../Scripts/plugins/validate/messages_zh.min.js"></script>
  <script>
    $(function () {      
      $("#EditForm").validate({
        rules: { //验证规则
          TypeName: {
            required: true
          },         
          TypeState: {
            required: true
          }
        },
        messages: { //对应的提示
          TypeName: {
            required: "类型名称必填"
          },
          TypeState:{
            required: "状态必选"
          }
        }
      });
      var id = window.location.href.split('?')[1].split('=')[1];
      $.get(currentUrl+'QuestionType/'+id,function(data) {
          $("#ID").val(data.id);
          $("#TypeName").val(data.typeName);
          $("#StateDisplay").val(data.stateDisplay);
          $("#Remark").val(data.remark);
      });
    });
  </script>
</body>
</html>